﻿<%@ Page Language="C#" MasterPageFile="~/FrameMasterPage.master" AutoEventWireup="true" CodeFile="WorkOrderSub.aspx.cs" Inherits="workOrderSub" Title="Untitled Page" %>
<%@ Register Assembly="EclipseWebSolutions.DatePicker" Namespace="EclipseWebSolutions.DatePicker"
    TagPrefix="ews" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="m_contentBody" Runat="Server">
<table  class="GridItem" cellspacing="2" cellpadding="2" style="width:100%;height:auto">
    <tr>
        <td class="BigLabel" >
            
            
            <asp:Label Width="100%" Height="100%" ID="lblTotalEquipment" runat="server" Text="Label"></asp:Label><asp:Label ID="lblMessageValidate1" runat="server" CssClass="permissionstyle"></asp:Label><asp:Label ID="lblMessageValidate2" runat="server" CssClass="permissionstyle"></asp:Label>
            
            
       <%-- width="100%" Height="300px" --%>
        </td>
        </tr>
        
         
        <tr>
        
        <td>

        <asp:GridView
         
            ID="grdWorkOrderTask" 
            runat="server" 
            AllowPaging="True" 
            AutoGenerateColumns="False" 
            OnPageIndexChanging="grdEquipment_PageIndexChanging" 
            AllowSorting="True" 
            onrowcancelingedit="grdEquipment_RowCancelingEdit" 
            onrowdatabound="grdEquipment_RowDataBound1" 
            RowHeaderColumn="EquipmentId" BorderStyle="None" 
            onselectedindexchanged="grdEquipment_SelectedIndexChanged" PageSize="20" 
            onrowcommand="grdEquipment_RowCommand" DataKeyNames="TaskInWorkOrderId" 
            DataSourceID="odsTask" onsorting="grdWorkOrderTask_Sorting">
           
                <SelectedRowStyle BackColor="#CDFFCC" />
           
                <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="30px" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" >
                            <ItemStyle Width="30px" />
                        </asp:CommandField>
                       
                        
                        <asp:TemplateField>
                            <ItemTemplate>
                
                                <a title="work order task's Detail" href="workOrderSub.aspx?detail=true&tabIndex=2&taskId=<%# DataBinder.Eval(Container.DataItem, "TASKINWORKORDERID") %>&workOrderId=<%# DataBinder.Eval(Container.DataItem, "WorkOrderId") %>&pageIndex=<%=GetPageIndex()%>""> 
                                    <img border=0 src="./images/b_view.png" width="20" height="20"><asp:Label Text="" ToolTip="View task in work Order" ID="view" runat="server"></asp:Label>
                                </a> 
                                
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <a title="delete task of work order " href="javascript:confirmDelete('workOrderSub.aspx?delete=true&tabIndex=0&taskId=<%# DataBinder.Eval(Container.DataItem, "TaskInWorkOrderId")%>&workOrderId=<%# DataBinder.Eval(Container.DataItem, "WorkOrderId") %>&pageIndex=<%=GetPageIndex()%>')">
                                    <img border=0 src="./images/del.png" width="15" height="15" >
                                </a>
             
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField>
                            <ItemTemplate>
                
                                <a title="view planning" href="workOrderSub.aspx?viewPlanning=true&tabIndex=2&taskId=<%# DataBinder.Eval(Container.DataItem, "TASKINWORKORDERID") %>&workOrderId=<%# DataBinder.Eval(Container.DataItem, "WorkOrderId") %>&pageIndex=<%=GetPageIndex()%>""> 
                                    <img border=0 src="./images/viewPlanning.png" width="20" height="20">
                                </a> 
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                
                                <a title="add planning" href="workOrderSub.aspx?addPlanning=true&tabIndex=2&taskId=<%# DataBinder.Eval(Container.DataItem, "TASKINWORKORDERID") %>&workOrderId=<%# DataBinder.Eval(Container.DataItem, "WorkOrderId") %>&pageIndex=<%=GetPageIndex()%>""> 
                                    <img border=0 src="./images/AddPlanning.png" width="20" height="20">
                                </a> 
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="TASKINWORKORDERID" HeaderText="Task Nº" 
                            SortExpression="TASKINWORKORDERID">
                <ItemStyle Width="50px" />
            </asp:BoundField>
            <asp:BoundField DataField="WORKORDERID" HeaderText="W.O Nº" SortExpression="WORKORDERID">
                <ItemStyle Width="50px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Required Date" DataField="DATEREQUIRED" 
                DataFormatString="{0:MM/dd/yyyy}" HtmlEncode="False" SortExpression="DATEREQUIRED">
                <ItemStyle Width="70px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Equipment code" DataField="CodeNumber" 
                            SortExpression="CodeNumber">
                <ItemStyle Width="150px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="System" DataField="System" SortExpression="System">
                <ItemStyle Width="60px" />
            </asp:BoundField>
            <asp:BoundField DataField="building" HeaderText="Building" SortExpression="building" >
                <ItemStyle Width="130px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Location" DataField="location" SortExpression="location" >
            </asp:BoundField>
            
        </Columns>
        <PagerStyle HorizontalAlign="Center" 
            VerticalAlign="Middle" />
        <EditRowStyle BackColor="LightGray" />
        <RowStyle CssClass="AlternativeRowStyle" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
       

        </td>
    </tr>
     <tr >
             <td  align="center" class="GridItem"  style="text-align:center">
             <asp:GridView ID="grdTemporary" runat="server" AllowPaging="True" Width="720px" 
                     AutoGenerateColumns="False"  Visible ="False" DataSourceID="dsMessage" 
                     
                      ForeColor="#333333" GridLines="None">
                 <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                 <RowStyle BackColor="#EFF3FB" />
                 <Columns>
                     <asp:BoundField DataField="Label" />
                 </Columns>
             
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                   <RowStyle BackColor="#EFF3FB" />
                   <SelectedRowStyle BackColor="#FF5050" />
                   <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" 
                        Width="30px" />
                        
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
                    
                 
             </asp:GridView >
             
                 
             </td>    
         </tr>
             
        
       <tr><td>
             <asp:Panel runat="server" ID="pnlBody">
<table   class="GridItem" style="width:100%; height:auto;">
        
    <tr>
   
    <td valign="top">
    <table>
                     
                         
                             
                              <caption>
                                  <br />
                                  <tr>
                                      <td class="BigLabelLeftAlign" colspan="2">
                                          <asp:Label ID="lblCodeNumber" runat="server"></asp:Label>
                                          <br />
                                          <br />
                                      </td>
                                  </tr>
                                  <tr>
                                      <td align="left" style="width: 165px">
                                          Work order ID</td>
                                      <td align="left">
                                          <asp:TextBox ID="txtWorkOrder" runat="server" AutoPostBack="True" 
                                              Enabled="False" Height="17px" Width="175px"></asp:TextBox>
                                      </td>
                                      <tr>
                                          <td align="left" style="width: 165px">
                                              Equipment ID</td>
                                          <td align="left">
                                              <asp:TextBox ID="txtEquipmentID" runat="server" AutoPostBack="True" Enabled="False" 
                                                  Height="17px" Width="175px" ontextchanged="txtEquipmentID_TextChanged"></asp:TextBox>
                                              &nbsp;
                                          </td>
                                          <tr>
                                              <td align="left" style="width: 165px">
                                                  Required date(mm/dd/yy)</td>
                                              <td align="left">
                                                  <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                                                      <ContentTemplate>
                                                          <ews:DatePicker ID="txtRequiredDate" runat="server" 
                                                              DateFormatString="MM/dd/yyyy" />
                                                      </ContentTemplate>
                                                  </asp:UpdatePanel>
                                                  <asp:Label ID="lblRequiredRequestDate" runat="server" ForeColor="Red"></asp:Label>
                                              </td>
                                          </tr>
                                          <tr>
                                              <td align="left" style="width: 165px">
                                                  Problem Group</td>
                                              <td align="left">
                                                  <asp:DropDownList ID="drlProblem" runat="server" 
                                                      Height="25px" Width="180px">
                                                  </asp:DropDownList>
                                                  <asp:Label ID="lblRequiredDepartment" runat="server" ForeColor="Red" 
                                                      Visible="False"></asp:Label>
                                                  &nbsp;
                                              </td>
                                          </tr>
                                          <tr>
                                              <td align="left" style="width: 165px; height: 60px;">
                                                  Problem</td>
                                              <td align="left" style="height: 60px">
                                                  <asp:TextBox ID="txtNewProblem" runat="server" Height="59px" Width="176px" 
                                                      Wrap="False"></asp:TextBox>
                                              </td>
                                          </tr>
                                          <tr>
                                              <td align="left" style="width: 165px; height: 40px;">
                                                  &nbsp;</td>
                                              <td align="left" style="height: 40px">
                                                  <asp:Button ID="btnCancel" runat="server" BorderStyle="Dotted" 
                                                      CssClass="btnexpress" Height="25px" onclick="btnCancel_Click" Text="Cancel" 
                                                      Width="71px" />
                                                  <asp:Button ID="btnValidate" runat="server" BorderStyle="Dotted" 
                                                      CssClass="btnexpress" Height="25px" onclick="btnValidate_Click" Text="Validate" 
                                                      Width="71px" /><asp:Label ID="lblMessageValidate" runat="server" CssClass="permissionstyle"></asp:Label>
                                                  &nbsp;&nbsp;&nbsp;
                                                  
                                              </td>
                                          </tr>
                                      </tr>
                                  </tr>
                              </caption>
    </table>
     </td></tr> 
    </caption>
                 </table>
  
                 <tr>
                     <td align="left">
                         <asp:Label ID="lblInformation" runat="server" ForeColor="Red"></asp:Label>
                         <asp:TextBox ID="txtHiddenEquipmentType" runat="server" Enabled="False" 
                             Height="17px" Visible="False" Width="175px"></asp:TextBox>
                     </td>
                 </tr>
  
                 <tr>
                     <td align="center" class="GridItem">
                         <asp:ObjectDataSource ID="odsTask" runat="server" 
                             OldValuesParameterFormatString="original_{0}" onselected="odsTask_Selected" 
                             SelectMethod="GetWorkOrderTasks" TypeName="WODirectService">
                             <SelectParameters>
                                 <asp:QueryStringParameter DefaultValue="0" Name="workOrderId" 
                                     QueryStringField="workOrderId" Type="Int32" />
                             </SelectParameters>
                         </asp:ObjectDataSource>
                         <asp:TextBox ID="txtHiddenPageIndex" runat="server" Visible="False"></asp:TextBox>
                         <asp:ObjectDataSource ID="dsMessage" runat="server" SelectMethod="GetMessage" 
                             TypeName="DirectService"></asp:ObjectDataSource>
                     </td>
                 </tr>
                 </td>
                 </tr>
                 </table>
  
                    
        </td></tr>     
      </asp:Panel> 
      <tr><td>
      
     <asp:Panel runat="server" ID="pnlPlanning">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan="2">
    <asp:Label ID="lblPlanning" runat="server" CssClass="BigLabelLeftAlign"></asp:Label>
    <br /><br /></td></tr>
                    <tr>
                        <td>
                        
                            </td>
                        <td style="width:100%" >
                            &nbsp;</td>
                        <td align="right">
                            </td>
                    </tr>
                </table>
                <table width="100%" border="0" cellpadding="3" cellspacing="0">
                    <tr valign="top">
                        <td style="width:30%">
                            Employee to be assigned</td>
                        <td style="width:70%">
                            
                            <asp:DropDownList ID="drlITStaff" runat="server" 
                                DataSourceID="odsITemployee" DataTextField="EmployeeName" 
                                DataValueField="EmployeeId" Height="25px" Width="180px" 
                                AppendDataBoundItems="True">
                                <asp:ListItem Value="-1">--- Choose an IT employee ---</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr valign="top">
                        <td style="width:30%" >
                            Plan date(mm/dd/yy)</td>
                        <td style="width:70%">
                            
                            <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <ews:DatePicker ID="txtPlanDate" runat="server" DateFormatString="MM/dd/yyyy" 
                                        DateRegularExpression="" />
                                </ContentTemplate>
                            </asp:UpdatePanel>
                            
                        </td>
                    </tr>
                    <tr valign="top">
                        <td style="width:30%" >
                            Plan time (hh:mm)</td>
                        <td style="width:70%">
                            <asp:TextBox runat="server" ID="txtPlanTime" Width="150" MaxLength="20"></asp:TextBox>
                            
                            <asp:Label ID="lblRequiredPlanTime" runat="server" ForeColor="Red"></asp:Label>
                            
                        </td>
                    </tr>
                    <tr valign="top">
                        <td style="width:30%" >
                            Estimate time (in minutes)</td>
                        <td style="width:70%">
                           
                            <asp:TextBox ID="txtEstimatedTime" runat="server" MaxLength="20" 
                                Width="150"></asp:TextBox>
                           
                        </td>
                            
                    </tr>
                    <tr valign="top">
                        <td  style="width:30%">
                            Priority</td>
                        <td style="width:70%">
                            <asp:DropDownList ID="drlPriority" runat="server" 
                                Height="25px" Width="100px">
                                <asp:ListItem>1</asp:ListItem>
                                <asp:ListItem>2</asp:ListItem>
                                <asp:ListItem>3</asp:ListItem>
                                <asp:ListItem>4</asp:ListItem>
                                <asp:ListItem>5</asp:ListItem>
                                <asp:ListItem>6</asp:ListItem>
                                <asp:ListItem>7</asp:ListItem>
                                <asp:ListItem>8</asp:ListItem>
                                <asp:ListItem>9</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr valign="top">
                        <td  style="width:30%; height: 26px;">
                            Remark</td>
                        <td style="width:70%; height: 26px;">
                            <asp:TextBox ID="txtRemark" runat="server" Height="62px" Width="335px" 
                                TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td  style="width:30%">
                            &nbsp;</td>
                        <td style="width:70%">
                            <asp:Button ID="btnCancelWorkOrder" runat="server" BorderStyle="Dotted" 
                                CssClass="btnexpress" Height="25px" onclick="btnCancelWorkOrder_Click" 
                                Text="Cancel" Width="71px" />
                            <asp:Button ID="btnValidateWorkOrder" runat="server" BorderStyle="Dotted" 
                                CssClass="btnexpress" Height="25px" onclick="btnValidateWorkOrder_Click" 
                                Text="Validate" Width="71px" /><asp:Label ID="lblMessageValidateAdd" runat="server" CssClass="permissionstyle"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="width:30%">
                            &nbsp;</td>
                        <td style="width:70%">
                            <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label>
                            <asp:TextBox ID="txtHiddenTaskId" runat="server" 
                                Height="17px" Visible="False" Width="175px"></asp:TextBox>
                            &nbsp;<asp:TextBox ID="txtHiddenPlanningId" runat="server" Enabled="False" 
                                Height="17px" Visible="False" Width="175px"></asp:TextBox>
                            <asp:ObjectDataSource ID="odsITemployee" runat="server" 
                                SelectMethod="GetAssignedEmployees" TypeName="Service.ReferenceDataService">
                            </asp:ObjectDataSource>
                        </td>
                    </tr>
                </table>
</asp:Panel>     
      </td></tr>   
      <tr><td>
        <asp:Panel runat="server" ID="pnlViewPlanning">
<div style=" height:350px; width:auto; overflow:auto">
</div>
<asp:Label ID="Label2" runat="server" ForeColor="Red"></asp:Label>
</asp:Panel>    
        </td>
        
    </tr>
    
      
       
      
   
         
    </table>

</asp:Content>

